package com.ruoyi.vehicle.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.vehicle.mapper.VehicleMapper;
import com.ruoyi.vehicle.domain.Vehicle;
import com.ruoyi.vehicle.service.IVehicleService;

/**
 * 车辆列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-08
 */
@Service
public class VehicleServiceImpl implements IVehicleService 
{
    @Autowired
    private VehicleMapper vehicleMapper;

    /**
     * 查询车辆列表
     * 
     * @param id 车辆列表主键
     * @return 车辆列表
     */
    @Override
    public Vehicle selectVehicleById(Long id)
    {
        return vehicleMapper.selectVehicleById(id);
    }

    /**
     * 查询车辆列表列表
     * 
     * @param vehicle 车辆列表
     * @return 车辆列表
     */
    @Override
    public List<Vehicle> selectVehicleList(Vehicle vehicle)
    {
        return vehicleMapper.selectVehicleList(vehicle);
    }

    /**
     * 新增车辆列表
     * 
     * @param vehicle 车辆列表
     * @return 结果
     */
    @Override
    public int insertVehicle(Vehicle vehicle)
    {
        vehicle.setCreateTime(DateUtils.getNowDate());
        return vehicleMapper.insertVehicle(vehicle);
    }

    /**
     * 修改车辆列表
     * 
     * @param vehicle 车辆列表
     * @return 结果
     */
    @Override
    public int updateVehicle(Vehicle vehicle)
    {
        vehicle.setUpdateTime(DateUtils.getNowDate());
        return vehicleMapper.updateVehicle(vehicle);
    }

    /**
     * 批量删除车辆列表
     * 
     * @param ids 需要删除的车辆列表主键
     * @return 结果
     */
    @Override
    public int deleteVehicleByIds(Long[] ids)
    {
        return vehicleMapper.deleteVehicleByIds(ids);
    }

    /**
     * 删除车辆列表信息
     * 
     * @param id 车辆列表主键
     * @return 结果
     */
    @Override
    public int deleteVehicleById(Long id)
    {
        return vehicleMapper.deleteVehicleById(id);
    }
}
